package com.androinject.examples.getstarted.controller;

import com.androinject.examples.getstarted.services.ExampleService;

public class ExampleController {

	private ExampleService service;
	
	public String computeResult(String first, String second) {
		int firstInt = Integer.parseInt(first);
		int secondInt = Integer.parseInt(second);
		
		// use the injected service to compute the result
		int result = this.service.doComplexComputation(firstInt, secondInt);
		return String.valueOf(result);
	}
	
	public void setService(ExampleService service) {
		// called by Andro Inject
		this.service = service;
	}
	
}
